<template>
	<view class="mainpadding2">
		<view class="mainpadding_top ffffff flexleft radius" v-for="item in list.data" :key="item.id" @click="jumpdetail('/pages/index/shangxueyxq?id=',item.id)">
			<image :src="item.image_text" class="leftListimg margin_right3" mode=""></image>
			<view class="">
				<view class="titletext bold hei_text">{{item.name}}</view>
				<view class="main_size margin_top bold xiaohui yhxk" style="width: 450rpx;">{{item.des}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(isPage, page) {
				let _this = this;
				let data = {
					page: page || 1,
					limit: _this.limit,
				}
				let url = '/api/index/sxyIdnex'
				httpRequest.request(url, 'GET', data, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
		}
	}
</script>

<style>

</style>
